else
pos = 0; // always insert at the top when dash is empty
- if (pos != this._dragPlaceholderPos && pos <= numFavorites && this._animatingPlaceholdersCount == 0) {
+ // Put the placeholder after the last favorite if we are not
+ // in the favorites zone
+ if (pos > numFavorites)
+ pos = numFavorites;
+
+ if (pos !== this._dragPlaceholderPos && this._animatingPlaceholdersCount === 0) {
this._dragPlaceholderPos = pos;
// Don't allow positioning before or after self
this._dragPlaceholder.show(fadeIn);
}
- // Remove the drag placeholder if we are not in the
- // "favorites zone"
- if (pos > numFavorites)
- this._clearDragPlaceholder();
-
if (!this._dragPlaceholder)
return DND.DragMotionResult.NO_DROP;